/*
 * @Author: your name
 * @Date: 2021-09-03 14:52:19
 * @LastEditTime: 2021-09-03 16:41:58
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: \briup\5-javascript\day10\7-经典继承.js
 */

function Animal(name) {
    this.name = name;
    this.colors = ["red", "pink", "blue"];
}

function Dog(name) {
    //经典继承 在子类构造函数借用父类构造函数，要产生关系用call
    //继承animal
    Animal.call(this.name);
    this.color = "hotpink";
}
Animal.prototype.sayName = function() {
    console.log(this.name);
}
console.log(Dog);